UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aaOaJzxdD+/vmdhF9dxvBj/HZhc5LrrQKk7WU8K1zE4=' 
WHERE 
  key_id = '115cc108a1575152e2680496aa08b2c1ef59371326f25436fcaf1d89582917a7' 
  AND (
    token = 'aaOaJzxdD+/vmdhF9dxvBj/HZhc5LrrQKk7WU8K1zE4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027