UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ma+/PPifkqPe/ZFFJxcmxCclcUoud+uengOCfLmeXaQ='
WHERE
key_id = '36639e219135c228a900c23022b4827d8dc9dc98bb99bda8e3bdbaa21bae24c1'
AND (
token = 'ma+/PPifkqPe/ZFFJxcmxCclcUoud+uengOCfLmeXaQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)