UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dqe2hY0eUEQ4n6oDkYUVkbBJdtl7KKpqAT6RRe6fMvU='
WHERE
key_id = '0580e370035417cb46c92fa47cbbc10f4629734cb884eeef5b1ca5c19a6d0bed'
AND (
token = 'dqe2hY0eUEQ4n6oDkYUVkbBJdtl7KKpqAT6RRe6fMvU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)