UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/0PLemssmz59Axpse4/vxu6MxE6HlKkGpXKStnvEJ14=' 
WHERE 
  key_id = 'e4b39f470c704050f18637c69a259f31c80e8e3726a419d3a54079f3e90ecd7d' 
  AND (
    token = '/0PLemssmz59Axpse4/vxu6MxE6HlKkGpXKStnvEJ14=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022