UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JqXvFZG/ozF1fg6BoxitJQSUCXw84P8kekbm9C8cKlw=' 
WHERE 
  key_id = 'a063485fb1ba958ae0702ee6ced7cef2c6aff393c9796500730360eae28b16ae' 
  AND (
    token = 'JqXvFZG/ozF1fg6BoxitJQSUCXw84P8kekbm9C8cKlw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031