UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0VjnZU+1jfq2SZjg0OgXfqnExH3q5qpZxiQ2uH+VQSw=' 
WHERE 
  key_id = 'b19365a9ce2f4ef9ac93d0fc815cbba77babeece9a2343e338a102b5a597d0f8' 
  AND (
    token = '0VjnZU+1jfq2SZjg0OgXfqnExH3q5qpZxiQ2uH+VQSw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030