UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eNDibH9WH3QRpCaFJIq8EI+wxe+VOtt/RKu/i5SVDqU='
WHERE
key_id = 'eb8bd933935dcaf5083ceff341ffdbdad91929eb1d2aadcf690549f97789286f'
AND (
token = 'eNDibH9WH3QRpCaFJIq8EI+wxe+VOtt/RKu/i5SVDqU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)