UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rsLT9c10UkSAg/1q6zpJz9Dya5dBf7JoqtMDCghZKVw='
WHERE
key_id = '8dfa1461ccb229535f0de78cc830ea947172884b1ba5d0192b20cd3f57cb8bfc'
AND (
token = 'rsLT9c10UkSAg/1q6zpJz9Dya5dBf7JoqtMDCghZKVw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)