UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rh8RlI4SpAkmjp7ZOt9Sie2w+a72BFpTtMvgRkpUje8='
WHERE
key_id = '8da7c9e7e43396f12713cd46835d0c87595eae371bccfb692107c024b36678ad'
AND (
token = 'rh8RlI4SpAkmjp7ZOt9Sie2w+a72BFpTtMvgRkpUje8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)