UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yj55yCbFCRp1N+w0onyzod/omaLiR3xEAn6MloCsKZY=' 
WHERE 
  key_id = '995d0036a2ae48504e0e2276c99a6854c99ad31eaae272781caf69979eafb8e3' 
  AND (
    token = 'yj55yCbFCRp1N+w0onyzod/omaLiR3xEAn6MloCsKZY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034