UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Gmkjx2EGVNRcr/XDKvxZaU0cZEG0aAThRJZ7gPyzyN4=' 
WHERE 
  key_id = '6e290625df4321327604434b79c4c1011c907e2c58bf119c5f87a592228c9848' 
  AND (
    token = 'Gmkjx2EGVNRcr/XDKvxZaU0cZEG0aAThRJZ7gPyzyN4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028