UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BY/rDxYuRNYExYivBcE4/Rz4qWbqxStOb61fbjlLyIU=' 
WHERE 
  key_id = '027aeca5cdf86d3e7d695ee35fc3b8029d4f89169739cdccf5f638e307ffcc41' 
  AND (
    token = 'BY/rDxYuRNYExYivBcE4/Rz4qWbqxStOb61fbjlLyIU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00061