UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k+NP6sgeyn6FRmy/svRtX132tj/HzOjQnQzoRKyWN80='
WHERE
key_id = '2e8e3b22a7a7fff2f431133033c183de0a567a0569f8c10e52c75ec6d77033e4'
AND (
token = 'k+NP6sgeyn6FRmy/svRtX132tj/HzOjQnQzoRKyWN80='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)