UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bolgCLZLuzCPGiW9PZq15XYJ0ekjFu132E3yaSlz3s4=' 
WHERE 
  key_id = '632d8d3716169753ce223bb7ad35595553c63969dc966711cc2428df23d92c30' 
  AND (
    token = 'bolgCLZLuzCPGiW9PZq15XYJ0ekjFu132E3yaSlz3s4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017