UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2tiZiFoQE/W20ZAGwis8FCDS/glNJvpcXjElScIHQUE=' 
WHERE 
  key_id = '6e16889b250f9974b4c238776d422d28fda85056f9092a38e42a297ed083c2c1' 
  AND (
    token = '2tiZiFoQE/W20ZAGwis8FCDS/glNJvpcXjElScIHQUE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030