UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4b6YdV9RaaYLunio8JN8VdyC+TRIVQjLAmnDZypcuhg='
WHERE
key_id = '0602f9bebd0b41db068a86eaa65e8c74a31f5af5b38e14040de35654833cc77f'
AND (
token = '4b6YdV9RaaYLunio8JN8VdyC+TRIVQjLAmnDZypcuhg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)