UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'H0ETvKw+chbzhAkP8dsv9LBD83CwrRyIWCCLqfIPhMk=' 
WHERE 
  key_id = 'd8ac91860fd0309d7c3e5c0f1daac2437a122075bb65725cad39203913a26a21' 
  AND (
    token = 'H0ETvKw+chbzhAkP8dsv9LBD83CwrRyIWCCLqfIPhMk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00012