UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bJg+9hqCx4Bnh703oWjzRXwCVPfEnQM3/U+Jp3WarIQ='
WHERE
key_id = 'ecb90f1596122adae649a9a7ad5ca5c1adb4d5255bf2f970b0ff37c9cdbdea7d'
AND (
token = 'bJg+9hqCx4Bnh703oWjzRXwCVPfEnQM3/U+Jp3WarIQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)