UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8LqpM1FuSGDY/LiDiihCKxFTvxwQeqcxSGX/zajqyDo='
WHERE
key_id = 'b3478c59629e46156bcea35ef1e5d559bc4b98533d0f958fc8056b8d80c21b41'
AND (
token = '8LqpM1FuSGDY/LiDiihCKxFTvxwQeqcxSGX/zajqyDo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)