UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yUhARiMhDlTBy1+sGL79C1u5zsMZiZKzFAu/HOGedi4=' 
WHERE 
  key_id = 'b8b048fe18cb1ab7818fb833f590d5cd53462f82bdeef3432ddaa42169a9f92c' 
  AND (
    token = 'yUhARiMhDlTBy1+sGL79C1u5zsMZiZKzFAu/HOGedi4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035