UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5f/WBj86fbViRw1JIOoqrRGAzYL/TlVXZRSH5VhYngU=' 
WHERE 
  key_id = '80d070d633ef070b3b220c6fb4f149044b2b7db3c301793539d3cad4ac21e6af' 
  AND (
    token = '5f/WBj86fbViRw1JIOoqrRGAzYL/TlVXZRSH5VhYngU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026