UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2Y2QoAT0OfoxVVB/7L2Ewkxda0a9+3Coz4cVQcEtuwo=' 
WHERE 
  key_id = '525eeef64b0d24bea66c50fe6b953dd8334039d1007f3ab8a4d17a25650c9f08' 
  AND (
    token = '2Y2QoAT0OfoxVVB/7L2Ewkxda0a9+3Coz4cVQcEtuwo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00059