UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IMz1ECjgyO/whMuzS1QLyH1M4l8jr5jJ9zfXTWug/UQ='
WHERE
key_id = 'b42c7be0c009d4d72163f10c246b9a9b0b03e56dc8ab7ebfbb78a3cfc06970a4'
AND (
token = 'IMz1ECjgyO/whMuzS1QLyH1M4l8jr5jJ9zfXTWug/UQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)