UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'S5T/E5lZKWRr9KsQo3+8d58NUsTwwWJugc/RimgMit0=' 
WHERE 
  key_id = '83d8f9ea42734540b1a29edf9756abce6f7ac745ba72c31adc15d40aa0e93f31' 
  AND (
    token = 'S5T/E5lZKWRr9KsQo3+8d58NUsTwwWJugc/RimgMit0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033