UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Bq5UuIyLv8727gjQQSCeEQE8s3YegFy5KnM7GUmU0BY='
WHERE
key_id = '46af44ed51b4d17cd41aec626a89262f2e16ed62c7f1e5826aa1d9ddcc92ba89'
AND (
token = 'Bq5UuIyLv8727gjQQSCeEQE8s3YegFy5KnM7GUmU0BY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)