UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YCPzZmvXLNOTG/b4BVNGZYddkniwWoh6TJhRwyuetgM=' 
WHERE 
  key_id = '4a9f7d42f34295d962376db808d0fa69748ff1c25a518c117d192d7823f2a421' 
  AND (
    token = 'YCPzZmvXLNOTG/b4BVNGZYddkniwWoh6TJhRwyuetgM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014