UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Hgt4sBoH4LEcvNnEQNVSgUpjthC4YXFWCFggzBYJAAQ='
WHERE
key_id = '6c2383e240f141c5772934d857ae3374f2a1a5dabf553a300bc381c690b393d9'
AND (
token = 'Hgt4sBoH4LEcvNnEQNVSgUpjthC4YXFWCFggzBYJAAQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)