UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '92itS4qAWUpF41m9OKx9M1kMIBhgtNniuEsPSDxA8wc=' 
WHERE 
  key_id = '52138fd0dc76717664830b1205e58ad6aa620901ea80a5d48f40f691547f6fc7' 
  AND (
    token = '92itS4qAWUpF41m9OKx9M1kMIBhgtNniuEsPSDxA8wc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038