UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nBl16GbKQhkwGdm0AuDWtLL97DL2oetzkUkamyoUYtY='
WHERE
key_id = 'f8a2c35da636e43ad56172b24d5ed9533e47d9236fd06ba3c9e5a2c1de597943'
AND (
token = 'nBl16GbKQhkwGdm0AuDWtLL97DL2oetzkUkamyoUYtY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)