UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZtlLtK2CueCMsM+op7rGsUwjz+ONvXYaCCRNrE6OA7Q=' 
WHERE 
  key_id = 'd1ec261f6d6c9d00ea060b7234fe2ed6348b37a79fa67c6acc28bb181f1755a6' 
  AND (
    token = 'ZtlLtK2CueCMsM+op7rGsUwjz+ONvXYaCCRNrE6OA7Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036