UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aG2qcdlLEbrIW2Lzt82foVXbr/Hqv93yUqQmOynjiek=' 
WHERE 
  key_id = '093ff0da8dc0832d4b1683239049ddea63a974ad0731de1d15a7fca4ca0a2c13' 
  AND (
    token = 'aG2qcdlLEbrIW2Lzt82foVXbr/Hqv93yUqQmOynjiek=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020