UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rNvaynMZ/RU1XnQeMFdhkuLmtL1zOF7elJSujsi4rCw=' 
WHERE 
  key_id = '3423279a075f449e4da33a2357baa62e9fd28cea7202dee8ee23138ab432f82e' 
  AND (
    token = 'rNvaynMZ/RU1XnQeMFdhkuLmtL1zOF7elJSujsi4rCw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052