UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FrWX0QwW21mnEbXMXXdLwqTQjlVxDE/SuSeo4G6KZEw=' 
WHERE 
  key_id = '87da665bb8fc2592e56c0a5f0281a84808a55afff56ebf21ad888a38a8b69393' 
  AND (
    token = 'FrWX0QwW21mnEbXMXXdLwqTQjlVxDE/SuSeo4G6KZEw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00083