UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9tYSy9dcrXVpvYBmjzjil37HnZxmWhYss2kj7x0JiVo=' 
WHERE 
  key_id = '85b8e9ce231b1b3306a4a79ded5990388f2aa8687ef735ec752a71b4e6660929' 
  AND (
    token = '9tYSy9dcrXVpvYBmjzjil37HnZxmWhYss2kj7x0JiVo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00282