UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iyI0/hfnMC7BaY+A0bR3LHGXpSGe+yqgPqqh5rGlb7s=' 
WHERE 
  key_id = '88d5186342477a7b735473b94a475403862d2d6fd30959ec2222de7502369b41' 
  AND (
    token = 'iyI0/hfnMC7BaY+A0bR3LHGXpSGe+yqgPqqh5rGlb7s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040