UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EIjKUB4/VB1B+TqO6k9DJY4qaOX6j4N1V58ZBGX3p3U=' 
WHERE 
  key_id = '8a7ee26f2fdd55459bf9f4ede9079628cebda61c76aa115110456f713b6e8f04' 
  AND (
    token = 'EIjKUB4/VB1B+TqO6k9DJY4qaOX6j4N1V58ZBGX3p3U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032