UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Hc2x68IQ6apnx8ZGff2qT2zuupSTBGaZ7IYFEM/t2tg='
WHERE
key_id = '5b3f339e4346bf8ce5378e63cace9bedde33f94accba2b76e434c0565a826ed7'
AND (
token = 'Hc2x68IQ6apnx8ZGff2qT2zuupSTBGaZ7IYFEM/t2tg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)