UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3z9dltnVjb/XGhJCggL6QolD0Cm83z1D1yt3yCGVdYU=' 
WHERE 
  key_id = 'fbf35d687dbe15c4c09f160c233fe2ae6697361b7be8e101ded4209a7d476a24' 
  AND (
    token = '3z9dltnVjb/XGhJCggL6QolD0Cm83z1D1yt3yCGVdYU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030