UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'r1JYSp/fHG9mxQagXEG4mWCfxxYYkpYwX3X5gQiK78g='
WHERE
key_id = '0d944b78cece08c5b3fa3e7ceafef4fd547df8eff1af1a1dc0bba5c735fe6b98'
AND (
token = 'r1JYSp/fHG9mxQagXEG4mWCfxxYYkpYwX3X5gQiK78g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)